#pragma once
/* Copyright(c) 1998-2012, Arnaud Colin
 * All rights reserved.
 *
 * Licence GNU GPL version 3
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   -> Redistributions of source code must retain the above copyright
 *      notice, this list of conditions and the following disclaimer.
 *
 *   -> Redistributions in binary form must reproduce the above copyright
 *      notice, this list of conditions and the following disclaimer in the
 *      documentation and/or other materials provided with the distribution.
 *
 *  Create from  Windows Input Simulator (C# SendInput Wrapper - Simulate Keyboard and Mouse)
 *  a project of michaelnoonan, you can find http://inputsimulator.codeplex.com/
 *
 */

#include "IInputSimulator.h"
#include "InputBuilder.h"
#include <vector>

template<typename T, unsigned int size>
unsigned int GetArrLength(T(&)[size]){return size;}

 

class  CKeyboardSimulator :
	public IKeyboardSimulator
{
private:
	IInputMessageDispatcher* _pmessageDispatcher;
	bool bNeedDelete;
    int SendSimulatedInput(INPUT& input);
	int SendSimulatedInput( CInputBuilder& inputbuilder );

public:
   
         CKeyboardSimulator(IInputMessageDispatcher* pmessageDispatcher);
         CKeyboardSimulator();
	     ~CKeyboardSimulator();
		 

         void KeyDown(VirtualKeyCode keyCode);
         void KeyUp(VirtualKeyCode keyCode);
         void KeyPress(VirtualKeyCode keyCode);
		 void KeyPress(VirtualKeyCode keyCode, const unsigned int count /*= 1*/ );
         void ModifiedKeyStroke(VirtualKeyCode modifierKeyCode, VirtualKeyCode keyCode);
         void ModifiedKeyStroke(std::vector<VirtualKeyCode>* modifierKeyCodes, VirtualKeyCode keyCode);
         void ModifiedKeyStroke(VirtualKeyCode modifierKey, std::vector<VirtualKeyCode>* keyCodes);
         void ModifiedKeyStroke(std::vector<VirtualKeyCode>* modifierKeyCodes, std::vector<VirtualKeyCode>* keyCodes);
         void TextEntry(LPCTSTR text);

};

